package com.bxg.setDemo;

import com.bxg.listDemo.Person;

import java.util.HashSet;

/*
* 存储自定义类型*/
public class Demo2 {

    public static void main(String[] args) {
        HashSet<Person> hashSet=new HashSet<>();
        hashSet.add(new Person("张三",1000));
        hashSet.add(new Person("李四",2000));
        hashSet.add(new Person("王五",3000));
        hashSet.add(new Person("李四",2000));
        System.out.println(hashSet);
    }
}
